<?php
/*
 * @project CreativeFramework
 * @generation Four
 * @author Jimmie Lin
 * @interface Frontend
 * @purpose This is the base G4 style, copy it to make your own.
 * @revision 01
 */
class Style implements UI_Interface{
	var $styleid = 0;
	var $stylename ="Generation 4 Hybrid";
	
	public function navmenu($navmenu = array()) {
		if(!defined("APPLICATION")) {
			foreach($navmenu as $x) {
				$this->menu[] = array(
					"title" => $x['title'],
					"app" => $x['app'],
					"controller" => $x['controller'],
					"extras" => $x['extras'],
					"icon" => $x['icon'],
					"active" => false
				);
			}
		}
		else {
			foreach($navmenu as $x) {
				$this->menu[] = array(
					"title" => $x['title'],
					"app" => $x['app'],
					"controller" => $x['controller'],
					"extras" => $x['extras'],
					"icon" => $x['icon'],
					"active" => (APPLICATION == $x['app'] and CONTROLLER == $x['controller'] ? true : false)
				);
			}
		}
	}
	
	public function header($pagetitle, $pagedesc) {
		global $Smarty;
		$Smarty->assign("pagetitle", $pagetitle);
		$Smarty->assign("pagedesc", $pagedesc);
		$Smarty->assign("menuarray", (isset($this->menu) ? $this->menu : array()));
		$Smarty->display(STYLE_TPL_PATH_RELATIVE."/header.tpl");
	}
	
	public function footer($debugarray) {
		global $Smarty, $Debug;
		$Smarty->assign("debugarray", $debugarray);
		if(IN_DEV) {
			$Smarty->assign("debugcount", $Debug->getLogCount());
			$Smarty->assign("debugmsg", $Debug->getLog());
		}
		$Smarty->display(STYLE_TPL_PATH_RELATIVE."/footer.tpl");
	}
}
